package es.unileon.prg2.censo.adapter;

import es.unileon.prg2.censo.iterator.CitizenIterator;
import es.unileon.prg2.censo.iterator.Iterador;
import es.unileon.prg2.censo.iterator.TreeIterator;

/**
 * @author Manuel Molinos Crespo, Adrian Campazas Vega, Alberto Castro Delgado, Pedro Alvarez Alvarez, Adrian Cabello Galvan, Jose Alvaro Fernandez Alvarez
 *
 */

public class ArrayListAggregate<Component> extends java.util.Vector implements Aggregate{
	
	public Iterador createIterator (){
	    return new TreeIterator(this);
	}
	
	public Iterador createIterator (int age, int age2){
		return new CitizenIterator((ArrayListAggregate<es.unileon.prg2.censo.composite.Component>) this.getArrayListAggregate(), age, age2);
	}
	
	public int getSize (){
	   return size();
	}
	
	public Object getElement (int index){
	   return elementAt(index);
	}
	
	public void removeElement (int index){
	   removeElementAt(index);
	}
	
	public ArrayListAggregate<Component> getArrayListAggregate() {
		return this;
	}
}
